package com.healthcloud.entity.PatientRecord;

import com.healthcloud.enums.DiseaseTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin on 2018/7/23.
 */
@Data
public class PatientInfoVo {

    private Integer id;
    //身份证号码
    private String  idcard;
    //病人姓名
    private String  realname;
    //性别
    private String sex;
    //年龄
    private Integer age;
    //出生日期
    private String birthday;
    //本人电话号码
    private String phone;
    //联系人电话号码
    private String  contactphone;
    //家庭地址
    private String homeaddress;

    private Long doctorId;

    private String doctor;

    private Long hospitalId;

    private String hospName;

    private String height;

    private String weight;

    private Double BMI;

    private Integer bpType;

    private Integer bsType;

    @ApiModelProperty(value = "骨松类型：1-普通患者；2-高危患者；3-确诊患者", name = "骨松类型：1-普通患者；2-高危患者；3-确诊患者")
    private Integer blType;

    private String bpComplication;

    private String bsComplication;

    private Integer smoke;

    private Integer drink;

    private Integer physical;

    private String diseaseDiagnosis;

    private Integer painLevel;

    private String waist;

    private String diseasesType;

    private Integer synchronizationType;

    private String synchronization;

    private Date synchronizationTime;

    private String serialNumber;

    private String remark;

    private Integer sign;

    private String registeraddress;

    private String education;

    private String nation;

    private Date createdTime;

    private String clan;

    private String career;

    @ApiModelProperty("最高血压值（高压）（收缩压）")
    private String highestBpSystolic;
    @ApiModelProperty("最高血压值（低压）（舒张压）")
    private String highestBpDiastolic;
    @ApiModelProperty("最高血压值-测量地点类型（1-诊室；2-家庭自测）")
    private Integer bpTestPlace;


    private String diseaseName;

    public String getDiseaseName() {

        StringBuilder diseaseNames = new StringBuilder();
        if(StringUtils.isNotBlank(getDiseasesType())) {
            String[] diseaseTypes = getDiseasesType().split("\\,");
            if (diseaseTypes.length > 0) {
                for (DiseaseTypeEnum diseaseTypeEnum : DiseaseTypeEnum.values()) {
                    for (String diseaseType : diseaseTypes) {
                        if (Integer.valueOf(diseaseType) == diseaseTypeEnum.getCode()) {
                            diseaseNames.append(diseaseTypeEnum.getMsg() + ",");
                        }
                    }
                }
            }
        }


        return diseaseNames.toString();
    }

    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }

}
